package org.tigris.subversion.svnant.commands;

import java.io.File;
import org.tigris.subversion.svnant.SvnAntUtilities;
import org.tigris.subversion.svnclientadapter.ISVNClientAdapter;
import org.tigris.subversion.svnclientadapter.SVNClientException;
import org.tigris.subversion.svnclientadapter.SVNRevision;
import org.tigris.subversion.svnclientadapter.SVNUrl;

public class Move extends SvnCommand
{
  private static final String MSG_CANT_COPY = "Can't copy";
  private File srcPath = null;
  private File destPath = null;
  private SVNUrl srcUrl = null;
  private SVNUrl destUrl = null;
  private String message = null;
  private boolean force = false;

  public void execute()
  {
    if (this.srcPath != null)
      try
      {
        getClient().move(this.srcPath, this.destPath, this.force);
      }
      catch (SVNClientException localSVNClientException1)
      {
        throw ex(localSVNClientException1, "Can't copy", new Object[0]);
      }
    else
      try
      {
        getClient().move(this.srcUrl, this.destUrl, this.message, SVNRevision.HEAD);
      }
      catch (SVNClientException localSVNClientException2)
      {
        throw ex(localSVNClientException2, "Can't copy", new Object[0]);
      }
  }

  protected void validateAttributes()
  {
    SvnAntUtilities.attrsNotSet("srcPath, srcUrl", true, new Object[] { this.srcPath, this.srcUrl });
    if (this.srcPath != null)
    {
      SvnAntUtilities.attrNotNull("destPath", this.destPath);
      SvnAntUtilities.attrNull("destUrl", this.destUrl);
    }
    if (this.srcUrl != null)
    {
      SvnAntUtilities.attrNotNull("destUrl", this.destUrl);
      SvnAntUtilities.attrNull("destPath", this.destPath);
      SvnAntUtilities.attrNotEmpty("message", this.message);
    }
  }

  public void setSrcPath(File paramFile)
  {
    this.srcPath = paramFile;
  }

  public void setDestPath(File paramFile)
  {
    this.destPath = paramFile;
  }

  public void setSrcUrl(SVNUrl paramSVNUrl)
  {
    this.srcUrl = paramSVNUrl;
  }

  public void setDestUrl(SVNUrl paramSVNUrl)
  {
    this.destUrl = paramSVNUrl;
  }

  public void setMessage(String paramString)
  {
    this.message = paramString;
  }

  public void setForce(boolean paramBoolean)
  {
    this.force = paramBoolean;
  }
}

/* Location:           C:\Users\Administrator\Desktop\svnant.jar
 * Qualified Name:     org.tigris.subversion.svnant.commands.Move
 * JD-Core Version:    0.6.0
 */